import { SalesCounsellingReport } from "@/types";

export function filterCounsellingTargetObj(
  targetName: string,
  salesCounsellingReports: SalesCounsellingReport[]
) {
  if (!salesCounsellingReports || salesCounsellingReports.length === 0) {
    return null;
  }
  const arr = salesCounsellingReports.filter(v => {
    return v.name === targetName;
  });
  if (arr && arr.length > 0) {
    return arr[0]?.report;
  }
  return null;
}
